package com.bwie.handler;

import com.bwie.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@Slf4j
public class GlobalExcepetion {

    @ExceptionHandler(value = Exception.class)
    @ResponseBody
    public R  Expecetion(Exception e){


        return R.ERROR(500,e.getMessage());
    }
}
